package com.powernode.batis.mapper;

import com.powernode.batis.pojo.Student;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface StudentMapper {
    Student selectById(Long id);

    List<Student> selectByName(String name);

    List<Student> selectByBirth(Date birth);

    List<Student> selectBySex(Character sex);

    int insertStudentByMap(Map<String, Object> map);

    int insertStudentByPojo(Student student);

    List<Student> selectByNameAndSex(String name, Character sex);

    /**
     * 使用@Param注解，指定参数名称
     *
     * @param name
     * @param sex
     * @return
     */
    List<Student> selectByNameAndSex2(@Param("name") String name, @Param("sex") Character sex);
}
